/*
 * IShopModel.java
 * business
 *
 * Created by ChenTao on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.model;

import com.yidiandao.business.data.bean.Goods;
import com.yidiandao.business.data.recyclertype.DoubleGoods;
import com.yidiandao.business.data.response.QueryShopCategoryResponse;
import com.yidiandao.business.data.response.QueryShopDetailHeaderResponse;
import com.yidiandao.business.data.response.QueryShopInfoResponse;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;

import java.util.List;

/** 店铺Model */
public interface IShopModel {

    /**
     * 加载首页热门商家列表
     *
     * @param isRefreshing 是否是下拉刷新
     */
    void loadHomeShopList(boolean isRefreshing, String tag, OnLoadShopsListener listener);

    /** 加载店铺详情页-顶部信息 */
    void loadShopDetailHeader(String supplierId, String tag, OnLoadShopHeaderListener listener);

    /** 加载店铺详情页-店铺信息 */
    void loadShopInfo(String shopId, String tag, OnLoadShopInfoListener listener);

    /** 加载 店铺详情页 - 最新商品 */
    void loadShopNewestGoods(
            boolean isRefreshing, String supplierId, String tag, OnLoadShopGoodsListener listener);

    /**
     * 加载店铺详情页-价格排序商品列表
     *
     * @param sortUp 是否为升序
     */
    void loadShopPriceGoods(
            boolean isRefreshing,
            boolean sortUp,
            String supplierId,
            String pagerTag,
            OnLoadShopGoodsListener onLoadShopGoodsListener);

    /** 加载店铺详情页-销量排序 */
    void loadShopSalesGoods(
            boolean isRefreshing, String supplierId, String tag, OnLoadShopGoodsListener listener);

    /**
     * 收藏/取消收藏店铺
     *
     * @param supplierId 店铺Id
     * @param isCollect 是否是收藏
     */
    void collectShop(String supplierId, boolean isCollect, String tag, OnAccessListener listener);

    /** 加载店铺分类 */
    void loadShopCategory(String supplierId, String tag, OnLoadShopCategoryListener listener);

    /** 加载店铺分类最新商品列表 */
    void loadCategoryNewGoodsList(
            boolean isRefreshing,
            String supplierId,
            String categoryId,
            String tag,
            OnLoadShopGoodsListener listener);

    /** 加载店铺分类价格排序商品列表 */
    void loadCategoryPriceGoodsList(
            boolean isRefreshing,
            String supplierId,
            String categoryId,
            boolean isSortUp,
            String tag,
            OnLoadShopGoodsListener listener);

    /** 加载店铺分类销量排序商品列表 */
    void loadCategorySalesGoodsList(
            boolean isRefreshing,
            String supplierId,
            String categoryId,
            String tag,
            OnLoadShopGoodsListener listener);

    interface OnLoadShopsListener {

        void onSuccess(
                List<DisplayListItem> displayListItems, boolean emptyData, boolean hasMoreData);

        void onFailed();
    }

    interface OnLoadShopInfoListener {

        void onSuccess(QueryShopInfoResponse.Data data);
    }

    interface OnLoadShopGoodsListener {

        void onSuccess(
                List<Goods> goodsList,
                List<DoubleGoods> goodsGridList,
                boolean emptyResult,
                boolean hasMoreData);

        void onFailed();

        void onFinal();
    }

    interface OnLoadShopHeaderListener {

        void onSuccess(QueryShopDetailHeaderResponse.Data data);

        void onFailed();
    }

    interface OnAccessListener {

        void onSuccess();
    }

    interface OnLoadShopCategoryListener {

        void onSuccess(List<QueryShopCategoryResponse.ShopCategory> shopCategoryList);

        void onFailed();
    }
}
